package cn.hr.entity;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


/**
 * 公司实体类
 */
@Entity
@Table(name="tb_company"
    ,catalog="hrm"
)

public class Company  implements java.io.Serializable {


    // Fields    

     /**
	 * 
	 */
	private static final long serialVersionUID = -8344944263456274376L;
	private Integer id;
     private College college;
     private String companyName;
     private String icon;
     private String properties;
     private String introduction;
     private String homepage;
     private Date createTime;
     private Set<Item> items = new HashSet<Item>(0);


    // Constructors

    /** default constructor */
    public Company() {
    }

	/** minimal constructor */
    public Company(College college, String companyName, String icon, String properties, String introduction) {
        this.college = college;
        this.companyName = companyName;
        this.icon = icon;
        this.properties = properties;
        this.introduction = introduction;
    }
    
    /** full constructor */
    public Company(College college, String companyName, String icon, String properties, String introduction, String homepage, Date createTime, Set<Item> items) {
        this.college = college;
        this.companyName = companyName;
        this.icon = icon;
        this.properties = properties;
        this.introduction = introduction;
        this.homepage = homepage;
        this.createTime = createTime;
        this.items = items;
    }

   
    // Property accessors
    @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="id", unique=true, nullable=false)

    public Integer getId() {
        return this.id;
    }
    
    public void setId(Integer id) {
        this.id = id;
    }
	@ManyToOne(fetch=FetchType.LAZY)
        @JoinColumn(name="collegeId", nullable=false)

    public College getCollege() {
        return this.college;
    }
    
    public void setCollege(College college) {
        this.college = college;
    }
    
    @Column(name="companyName", nullable=false, length=32)

    public String getCompanyName() {
        return this.companyName;
    }
    
    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }
    
    @Column(name="icon", nullable=false)

    public String getIcon() {
        return this.icon;
    }
    
    public void setIcon(String icon) {
        this.icon = icon;
    }
    
    @Column(name="properties", nullable=false, length=50)

    public String getProperties() {
        return this.properties;
    }
    
    public void setProperties(String properties) {
        this.properties = properties;
    }
    
    @Column(name="introduction", nullable=false, length=65535)

    public String getIntroduction() {
        return this.introduction;
    }
    
    public void setIntroduction(String introduction) {
        this.introduction = introduction;
    }
    
    @Column(name="homepage")

    public String getHomepage() {
        return this.homepage;
    }
    
    public void setHomepage(String homepage) {
        this.homepage = homepage;
    }
    @Temporal(TemporalType.DATE)
    @Column(name="createTime", length=0)

    public Date getCreateTime() {
        return this.createTime;
    }
    
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="company")

    public Set<Item> getItems() {
        return this.items;
    }
    
    public void setItems(Set<Item> items) {
        this.items = items;
    }
   








}